package com.zhuss.core.book;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.core.book.DetailBookBo;
import com.zhuss.bean.bo.core.book.SearchBookBo;
import com.zhuss.common.ReadService;
import com.zhuss.core.processor.BookRead;
import com.zhuss.exception.AabException;


/**
 * Book查询service（基本查询）
 * @author zhushanshuo
 * @Date 2019-12-13 15:59
 *
 */
@Component("bookReadService")
public class BookReadService implements ReadService<Object, Object> {
	
	@Autowired
	@Qualifier("bookRead")
	private BookRead bookRead;
	
	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws AabException {
		DetailBookBo bo = (DetailBookBo) param;
		Long bookId = bo.getBookId();
		Object vo = bookRead.detail(bookId);
		return vo;
	}
	
	/**
	 * 列表
	 * @throws AabException 
	 */
	@Override
	public Object list(Object param) throws AabException {
		SearchBookBo bo = (SearchBookBo) param;
		Object result = bookRead.list(bo);
		return result;
	}
	
	/**
	 * 全部数据
	 * @throws AabException
	 */
	public Object listAll() throws AabException {
		Object result = bookRead.listAll();
		return result;
	}
	
}

